home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
DO1002.ARJ
/
RETURNCD.SCR
< prev
next >
Wrap
Text File
|
1991-12-13
|
1KB
|
44 lines
.pg wi full clr cy
COMMAND NAME»gray«: »%t« ReturnCode »ye«
/RETURNCODE [{code}]
/cw
Sets the »ye«code»#« returned to DOS when »%t«DO»#« exits.
»cy«{code}»#« must be numeric. The default return code is »ma«zero»#« ("0").
If »cy«{code}»#« is not included, the return code is set to »gr«zero»#«.
The code can be tested with the DOS »wh«ERRORLEVEL»#« function. Here is
an example of a »%t«DO»#« script and the BATch file which executes it:
»gray«---- »ye«Start of script »gray«------------------------------------»cy«
* SCRIPT: HaltTest
/SET Default 0
/GETS Code Default "Return Code?" 2
/RETURNCODE %%Code
»gr«/HALT»gray«
---- »ye«End of script»gray« --------------------------------------
.pg
---- »ye«Start of Batch File»gray« --------------------------------»cy«
@echo OFF
:TOP
»ye«do halttest»cy«
if »gr«ERRORLEVEL»cy« 2 GOTO R2
if »gr«ERRORLEVEL»cy« 1 GOTO R1
echo Returned ERRORLEVEL 0
GOTO End
:R2
echo Returned ERRORLEVEL 2 or higher
pause
GOTO Top
:R1
echo Returned ERRORLEVEL 1 or higher
pause
GOTO Top
:End
»gray«---- »ye«End of Batch File»gray« ----------------------------------»#«
It is important to note that »cy«ERRORLEVEL»#« tests for the value or
»+re«HIGHER»#«.
/ENDEXEC CLEAR